use std::collections::HashSet;

use scraper::{Html, Selector};

fn main() {
    let document = Html::parse_document(&std::fs::read_to_string("index.html").unwrap());

    let selector = Selector::parse(r#"ol[class="chapter"]"#).unwrap();

   //let mut set = HashSet::new();

    // let mut ret = Vec::new();

    let urls = document.select(&selector).nth(0).unwrap();

    let selector2 = Selector::parse(r#"a"#).unwrap();

    // 遍历匹配到的所有元素
    for url in urls.select(&selector2) {
        println!("{:?}", url);
    }
}
